Binary Search Tree


Q1.

Suppose a binary search tree with 1000 distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assuming that the array indices start with 0, the 3rd largest element of the tree is stored at index _______.
GateOverflow

Q2.

A binary search tree T contains n distinct elements. What is the time complexity of picking an element in T that is smaller than the maximum element in T?
GateOverflow

Q3.

What is the in-order successor of 15 in the given binary search tree?
GateOverflow

Q4.

The preorder traversal of a binary search tree is 15,10,12,11,20,18,16,19. Which one of the following is the postorder traversal of the tree?
GateOverflow

Q5.

The pre-order transversal of a binary search tree is given by 12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20. Then the post-order traversal of this tree is:
GateOverflow

Q6.

Let T be a binary search tree with 15 nodes. The minimum and maximum possible heights of T are : Note: The height of a tree with a single node is 0.
GateOverflow

Q7.

How many distinct binary search trees can be created out of 4 distinct keys?
GateOverflow

Q8.

Consider the following binary search tree T given below: Which node contains the fourth smallest element in T?
GateOverflow

Q9.

We are given a set of n distinct elements and an unlabeled binary tree with n nodes. In how many ways can we populate the tree with the given set so that it becomes a binary search tree?
GateOverflow

Q10.

Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of n nodes?
GateOverflow